<template>
	<view class="uni-load-more">
		<view  v-if="status != '' && status != undefined" style="display: flex; justify-content: center;">
			<view class="uni-load-more__img" v-show="status === 'loading' && showIcon">
				<!-- <view class="load1">
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
				</view>
				<view class="load2">
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
				</view>
				<view class="load3">
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
					<view :style="{background:color}"></view>
				</view> -->
			</view>
			<text class="uni-load-more__text" :style="{color:color}">{{status === 'more' ? contentText.contentdown : (status === 'loading' ? contentText.contentrefresh : contentText.contentnomore)}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "uni-load-more",
		props: {
			status: {
				//上拉的状态：more-loading前；loading-loading中；noMore-没有更多了
				type: String,
				default: 'more'
			},
			showIcon: {
				type: Boolean,
				default: true
			},
			color: {
				type: String,
				default: "#777777"
			},
			contentText: {
				type: Object,
				default () {
					return {
						contentdown: "上拉显示更多",
						contentrefresh: "正在加载...",
						contentnomore: "没有更多数据了"
					};
				}
			}
		},
		data() {
			return {}
		}
	}
</script>

<style>
	@charset "UTF-8";

	.uni-load-more {
		display: flex;
		flex-direction: row;
		height: 80upx;
		align-items: center;
		justify-content: center
	}

	.uni-load-more__text {
		font-size: 28upx;
		color: #999
	}

	.uni-load-more__img {
		height: 24px;
		width: 24px;
		margin-right: 10px
	}

	@-webkit-keyframes load {
		0% {
			opacity: 1
		}

		100% {
			opacity: .2
		}
	}
</style>